<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>购买商品 - 确认订单</title>
    <style>
        /* 全局样式重置与基础设置 */
        * {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
            font-family: 'Microsoft YaHei', 'Helvetica Neue', Arial, sans-serif;
        }

        body {
            background-color: #f5f7fa;
            background-image: linear-gradient(120deg, #f0f4f8 0%, #e6edf5 100%);
            min-height: 100vh;
            padding: 20px 0;
        }

        /* 表单容器样式 */
        .form-box {
            width: 100%;
            max-width: 500px;
            margin: 30px auto;
            padding: 35px;
            background-color: #ffffff;
            border-radius: 12px;
            box-shadow: 0 8px 24px rgba(149, 157, 165, 0.15);
            transition: all 0.3s ease;
        }

        .form-box:hover {
            box-shadow: 0 12px 32px rgba(149, 157, 165, 0.2);
            transform: translateY(-2px);
        }

        /* 标题样式 */
        .form-box h2 {
            text-align: center;
            color: #2d3748;
            font-size: 24px;
            margin-bottom: 30px;
            padding-bottom: 15px;
            border-bottom: 1px solid #edf2f7;
        }

        /* 表单组样式 */
        .form-group {
            margin-bottom: 22px;
        }

        .form-group label {
            display: block;
            margin-bottom: 8px;
            color: #4a5568;
            font-size: 15px;
            font-weight: 500;
        }

        /* 输入框样式 */
        .form-group input[type="text"],
        .form-group input[type="tel"],
        .form-group input[type="number"],
        .form-group input[type="datetime-local"] {
            width: 100%;
            padding: 12px 15px;
            border: 1px solid #e2e8f0;
            border-radius: 8px;
            font-size: 15px;
            color: #2d3748;
            transition: all 0.2s ease;
            background-color: #f9fafb;
        }

        /* 输入框交互效果 */
        .form-group input:focus {
            outline: none;
            border-color: #4299e1;
            box-shadow: 0 0 0 3px rgba(66, 153, 225, 0.1);
            background-color: #ffffff;
        }

        .form-group input::placeholder {
            color: #a0aec0;
            font-size: 14px;
        }

        /* 按钮样式组 */
        .btn-group {
            display: flex;
            gap: 12px;
            margin-top: 30px;
        }

        /* 提交按钮 */
        input[type="submit"] {
            flex: 1;
            background-color: #3182ce;
            color: white;
            padding: 12px 0;
            border: none;
            border-radius: 8px;
            font-size: 16px;
            font-weight: 500;
            cursor: pointer;
            transition: all 0.3s ease;
            text-align: center;
        }

        input[type="submit"]:hover {
            background-color: #2b6cb0;
            transform: translateY(-1px);
        }

        input[type="submit"]:active {
            transform: translateY(1px);
            box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.1);
        }

        /* 取消按钮（链接样式） */
        .btn-cancel {
            flex: 1;
            display: inline-flex;
            align-items: center;
            justify-content: center;
            background-color: #edf2f7;
            color: #4a5568;
            padding: 12px 0;
            border-radius: 8px;
            font-size: 16px;
            font-weight: 500;
            text-decoration: none;
            transition: all 0.3s ease;
        }

        .btn-cancel:hover {
            background-color: #e2e8f0;
            color: #2d3748;
            transform: translateY(-1px);
        }

        .btn-cancel:active {
            transform: translateY(1px);
        }

        /* 响应式适配（移动端） */
        @media (max-width: 768px) {
            .form-box {
                padding: 25px 20px;
                margin: 20px 15px;
            }

            .form-box h2 {
                font-size: 22px;
                margin-bottom: 25px;
            }

            .btn-group {
                flex-direction: column;
                gap: 10px;
            }
        }
    </style>
</head>
<body>
    <div class="form-box">
        <h2>填写购买信息</h2>
        <form action="PurchaseServlet?method=submit" method="post">
            <input type="hidden" name="productId" value="${param.productId}">
            
            <div class="form-group">
                <label for="buyerName">您的姓名</label>
                <input type="text" id="buyerName" name="buyerName" required placeholder="请输入您的真实姓名">
            </div>

            <div class="form-group">
                <label for="location">交易地点</label>
                <input type="text" id="location" name="location" required placeholder="请输入具体交易地址（如XX商场XX店铺）">
            </div>

            <div class="form-group">
                <label for="tradeTime">交易时间</label>
                <input type="datetime-local" id="tradeTime" name="tradeTime" required>
            </div>

            <div class="form-group">
                <label for="phone">联系电话</label>
                <input type="tel" id="phone" name="phone" required placeholder="请输入11位手机号码" pattern="1[3-9]\d{9}">
            </div>

            <div class="form-group">
                <label for="amount">交易金额（元）</label>
                <input type="number" id="amount" name="amount" required step="0.01" min="0" placeholder="请输入交易总金额">
            </div>

            <div class="form-group">
                <label for="deposit">押金（元）</label>
                <input type="number" id="deposit" name="deposit" required step="0.01" min="0" placeholder="请输入押金金额">
            </div>

            <div class="btn-group">
                <input type="submit" value="提交购买意向">
                <a href="product.jsp" class="btn-cancel">取消</a>
            </div>
        </form>
    </div>
</body>
</html>